<div id="postid" class="form-comment-wrap large-12 columns">
<div class="heads large-12 column">
<div class="headpost large-12 column">
	<ul class="inline-list">
		<li class="cht"><img src="<?= BASE_URI ?>img/icons/chat.png">
			<a>
				&nbsp;&nbsp;Status Updates&nbsp;&nbsp;&nbsp;|
			</a>
		</li>
		<input type="file" accept = "image/*" id="upload" name="upload" style="visibility: hidden; width: 1px; height: 1px" multiple />
		<li class="cam"><img src="<?= BASE_URI ?>img/icons/cam.png">
			<a id="btnUpload">
				&nbsp;&nbsp;Upload Photo
			</a>
		</li>
		<li id="postLoading" class="right"><img src="<?= BASE_URI ?>img/loading.gif"></li>

	</ul>
</div>
</div>
	<div class="text-area large-12 columns">
		<textarea class="textarea-xpnd"  id="info" placeholder="What's in your mind?"></textarea>
		
	</div>
	<div id="out">
	</div>
	
	<div class="large-12 columns">
		<a id="btnPost" class="postbutton right radius button">Post</a>
	</div>
</div>


<!--wall post starts here-->
<div id="postContainer">
<?php foreach ($feeds as $value) { ?>

 <div id="<?= $value->uft->id ?>" class="wall-post large-12 columns">
	<div class="wall-head large-12 column">
		<div class="dp-tmb large-2 columns" style="background:url('<?= IMAGE_URL_SMALL.$value->uat->profile_pic ?>');background-size:cover;">
		</div>
		<div class="wall-info large-9 columns">
			<a href="<?= BASE_URI.'profile?bhd='.$value->uat->id; ?>"><?= $value->uat->fname.' '.$value->uat->lname ?></a>
			<p><small><i class="fa fa-clock-o"> <abbr class="timeago" title="<?= $value->uft->date_created ?>"></abbr></i></small></p>
		</div>
		<div class="extra large-1 column"></div>
	</div>
	<div class="wall-content large-12 column">
		<p><?= $value->uft->feed_title ?></p>
		<?= $value->uft->feed_container ?>
	</div>
	<div class="wall-att large-12 column">
		
	</div>
	<div class="likeshare large-12 column">
		<div class="large-6 column">
			<ul class="inline-list">
				<li><a id="feed_like_id_<?= $value->uft->id ?>" feed-like-id="<?= $value->uft->id ?>"class="btnLike"><?php if(FeedsLikesTb::checkIfLiked($value->uft->id,$this->session->get('user_id')) == true){
					echo "Unlike";
				}else{
					echo "Like";
				}
				?></a></li>
				<li><a>Comment</a></li>
				<li><a>Report</a></li>
			</ul>
		</div>
		<div class="text-right large-4 column">
			<p id="feeds_total_likes_<?= $value->uft->id ?>"><?= FeedsLikesTb::countLikes($value->uft->id) ?> People like this</p> 
		</div>
	</div>
	<div class="commentsection large-12 column">
		<div class="textareafrm">
			<textarea class="commentbox textarea-xpnd" id="<?= $value->uft->id ?>" receiver-id="<?= $value->uat->id ?>" placeholder="Comment"></textarea>
		</div>
		<div id="<?= 'feeds_comment_'.$value->uft->id ?>" class="commentarea large-12 column">
			<?php foreach (FeedsCommentsTb::find(array(
					"conditions"=>"feeds_id = ?0",
					"bind"=>array(0=>$value->uft->id)
				)) as $comment) { ?>
			<div id="<?= $comment->id ?>" class="usercomment large-12 column">
				<div class="dp-comment large-1 columns" style="background:url('<?= IMAGE_URL_SMALL.UserAccountTb::getProfilePicUrl($comment->user_id) ?>');background-size:cover;">
				</div>
				<div class="usercommentinfo large-10 column">
					<a href="<?=  BASE_URI.'profile?bhd='.$comment->user_id; ?>"><?= UserAccountTb::getFullname($comment->user_id); ?></a>&nbsp;&nbsp;<small><i class="fa fa-clock-o"> <abbr class="timeago" title="<?= $comment->date_created ?>"></abbr></i></small>
					<p><?= $comment->comment_container ?></p>
				</div>
				<div class="editicon large-1 column">
					<i class="right fa fa-pencil-square-o"></i>
				</div>
			</div>
			<?php } ?>
		</div>
	</div>
</div>	
<?php } ?>

</div> <!-- end of postContainer -->		
<div id="loadmore">
	<center>Loading more..<img src="<?=BASE_URI?>img/loading.gif"/> </center>
</div>		


<script type="text/javascript">

	$(document).ready(function(){
		var $loadmore = $('#loadmore');
		$loadmore.hide();
			// infinite loading
			$(window).scroll(function(){
				if($(window).scrollTop() == $(document).height() - $(window).height())
				{
					$loadmore.show();
				}
			});
	});
</script>
<script type="text/javascript" src="<?=BASE_URI?>js/feeds.js"></script>


